﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForms.aspx.cs" Inherits="VMWorkshop.Web.WebForms" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link type="text/css" rel="Stylesheet" href="../content/global.css" />
</head>
<body>
    <h1>WebForms Products Editor</h1>
    <form id="form1" runat="server">
    <asp:GridView 
        id="grdProducts"
        AutoGenerateColumns="False"
        AlternatingRowStyle-CssClass="alt"
        runat="server" 
        DataKeyNames="ProductId" 
        onselectedindexchanged="grdProducts_SelectedIndexChanged">
        <Columns>
            <asp:CommandField ShowSelectButton="true" />
            <asp:BoundField HeaderText="Title" DataField="Title" />
            <asp:BoundField HeaderText="Description" DataField="Description" />
            <asp:BoundField HeaderText="Qty" DataField="QuantityOnHand" />
        </Columns>
    </asp:GridView>

    <asp:PlaceHolder ID="plcEditor" runat="server">
        <div id="product">
            <asp:ValidationSummary runat="server" />
            <input type="hidden" id="productId" name="hdnProductId" runat="server" />
            <div class="item">
                <div class="lbl"><label for='<%= title.ClientID %>'>Title</label></div>
                <div class="ctl">
                    <asp:TextBox ID="title" runat="server" />
                    <asp:RequiredFieldValidator 
                        ID="rfvTitle" 
                        ControlToValidate="title"
                        Text="*"
                        ErrorMessage="Title is required"
                        runat="server" />
                </div>
            </div>
            <div class="item">
                <div class="lbl"><label for='<%= description.ClientID %>'>Description</label></div>
                <div class="ctl">
                    <asp:TextBox ID="description" TextMode="MultiLine" runat="server" />
                    <asp:RequiredFieldValidator 
                        ID="rfvDescription" 
                        ControlToValidate="description"
                        Text="*"
                        ErrorMessage="Description is required"
                        runat="server" />
                </div>
            </div>
            <div class="item">
                <div class="lbl"><label for='<%= quantityOnHand.ClientID %>'>Qty on Hand</label></div>
                <div class="ctl">
                    <asp:TextBox ID="quantityOnHand" runat="server" />
                    <asp:RequiredFieldValidator 
                        ID="rfvQuantityOnHand" 
                        ControlToValidate="quantityOnHand"
                        Text="*"
                        ErrorMessage="Quantity on hand is required"
                        runat="server" />
                </div>
            </div>
            <div class="item">
                <div class="lbl"><label for='<%= releaseDate.ClientID %>'>Release Date</label></div>
                <div class="ctl">
                    <asp:TextBox ID="releaseDate" runat="server" />
                    <asp:RequiredFieldValidator 
                        ID="rfvReleaseDate" 
                        ControlToValidate="releaseDate"
                        Text="*"
                        ErrorMessage="Release date is required"
                        runat="server" />
                </div>
            </div>
            <div class="item">
                <div class="lbl"><label for='<%= price.ClientID %>'>Price</label></div>
                <div class="ctl">
                    <asp:TextBox ID="price" runat="server" />
                    <asp:RequiredFieldValidator 
                        ID="rfvPrice" 
                        ControlToValidate="price"
                        Text="*"
                        ErrorMessage="Price is required"
                        runat="server" />
                </div>
            </div>
            <div class="item">
                <div class="nolbl">&nbsp;</div>
                <div class="ctl"><asp:Button ID="btnSave" Text="Save" runat="server" onclick="btnSave_Click" /></div>
            </div>
        </div>
    </asp:PlaceHolder>
    <asp:PlaceHolder ID="plcSaveComplete" runat="server">
        <div id="updateMsg">Updates are complete.</div>
    </asp:PlaceHolder>
    </form>
</body>
</html>
